<div class="container">
	<form action="<?=$this->action?>" method="post">
	<h4>Điện thoại di động <?=$this->phone->name?></h4>
	<div class="row">
		<div class="col-xs-3">
			<img src="<?=WEB_PATH?>/public/imgs/<?=$this->phone->image_url?>"
				class="img-thumbnail">
			<a class="btn btn-success" href="<?=WEB_PATH?>/admin/phone/uploadimg/id/<?=$this->phone->id?>">Đổi ảnh</a>
		</div>
		<div class="col-xs-9">
			<div class="panel panel-success">
				<div class="panel-heading">
					<b>Chi tiết</b>
				</div>
				<div class="panel-body">
					<?php if ($this->errors) {?>
						<?php foreach($this->errors as $error) {?>
							<div class="alert alert-danger"><?=$error?></div>
						<?php }?>
					<?php }?>
					<?php if($this->success) {?>
						<div class="alert alert-success">Cập nhật thành công</div>
					<?php }?>
					<table class="table">
						<tr class="">
							<td>Tên sản phẩm</td>
							<td><input type="text" name="name" class="form-control" value='<?=$this->phone->name?>'></td>
						</tr>
						<tr class="active">
							<td>Màn hình</td>
							<td><input type="text" name="screen" class="form-control" value='<?=$this->phone->screen?>'></td>
						</tr>
						<tr >
							<td>CPU</td>
							<td><input type="text" name="cpu" class="form-control" value='<?=$this->phone->cpu?>'></td>
						</tr>
						<tr class="active">
							<td>Hệ điều hành</td>
							<td><input type="text" name="os" class="form-control" value='<?=$this->phone->os?>'></td>
						</tr>
						<tr >
							<td>Camera</td>
							<td><input type="text" name="camera" class="form-control" value='<?=$this->phone->camera?>'></td>
						</tr>
						<tr class="active">
							<td>Bộ nhớ trong</td>
							<td><input type="text" name="memory" class="form-control" value='<?=$this->phone->memory?>'></td>
						</tr>
						<tr >
							<td>Dung lượng pin</td>
							<td><input type="text" name="pin" class="form-control" value='<?=$this->phone->pin?>'></td>
						</tr>
						<tr class="active">
							<td>Số sim</td>
							<td><input type="number" min='1' max='4' name="sim" class="form-control" value='<?=$this->phone->sim?>'></td>
						</tr>
						<tr class="">
							<td>Hãng</td>
							<td>
								<select name="catagory-id" class="form-control">
									<?php foreach ($this->catagories as $category) {?>
										<option <?=$category->id == $this->phone->catagory_id ? 'selected' : ''?> value="<?=$category->id?>"><?=$category->name?></option>
									<?php }?>
								</select>
							</td>
						</tr>
						<tr class="active">
							<td>Giá</td>
							<td><input type="number" min='1000' max='50000000' name="price" class="form-control" value='<?=$this->phone->price?>'></td>
						</tr>
						<tr class="">
							<td>Màu</td>
							<td><input type="text" name="color" class="form-control" value='<?=$this->phone->color?>'></td>
						</tr>
					</table>
					<input type="submit" class="btn btn-success" value="Lưu">
					<a class="btn btn-success" href="<?=WEB_PATH?>/admin/phone">Back</a>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
		<h4>Tags: </h4>
		<?php foreach($this->tags as $tag){?>
			<a href=""><?=$tag->tag_name?></a>
		<?php }?>
		<a class="btn btn-success" href="<?=WEB_PATH?>/admin/tag/product/id/<?=$this->id?>">Quản lý tag</a>
	</div>
	</form>
</div>